﻿//Author:Michal Sporna
//License: https://operationsneakpeek.codeplex.com/license

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Levels
{
    public class AvatarPlacement
    {
        #region properties
        //avatar placement
        //avatar start pos
        public int AvatarStartX;
        public int AvatarStartY;
        public Characters.Avatar.States AvatarState;

        public string AvatarStateString;
        #endregion

        #region METHODS

        /// <summary>
        /// convert string avatar state to enum
        /// </summary>
        public void ConvertAvatarState()
        {
            //IdleRight, IdleLeft, IdleUp, IdleDown
            try
            {
                switch (AvatarStateString)
                {
                    case "IdleRight":
                        {
                            this.AvatarState = Characters.Avatar.States.IdleRight;
                            break;
                        }
                    case "IdleLeft":
                        {
                            this.AvatarState = Characters.Avatar.States.IdleLeft;
                            break;
                        }
                    case "IdleUp":
                        {
                            this.AvatarState = Characters.Avatar.States.IdleUp;
                            break;
                        }
                    case "IdleDown":
                        {
                            this.AvatarState = Characters.Avatar.States.IdleDown;
                            break;
                        }

                }
            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;
            }
        }

        #endregion
    }
}
